#!/usr/bin/python -tt

from optparse import OptionParser
from fitswriter import DrsCalibFitsWriter
import sys

parser = OptionParser()
parser.add_option("-f", "--file", dest="filename",
    help="write report to FILE", metavar="FILE")
options, args = parser.parse_args()
if options.filename is None:
    print 'Please submit a filename. "', sys.argv[0],'-h" for help'
    sys.exit(1)



drsfile = DrsCalibFitsWriter(options.filename)
#~ ('RunNumberBaseline', '<u4'), 
#~ ('RunNumberGain', '<u4'), 
#~ ('RunNumberTriggerOffset', '<u4'),
#~ ('BaselineMean', '<f4', (1440,1024)),
#~ ('BaselineRms', '<f4', (1440,1024)),
#~ ('GainMean', '<f4', (1440,1024)),
#~ ('GainRms', '<f4', (1440,1024)),
#~ ('TriggerOffsetMean', '<f4', (1440,1024)),
#~ ('TriggerOffsetRms', '<f4', (1440,1024)) ]) )
#~ 

drsfile.drscalib['BaselineMean'] = 0.
drsfile.drscalib['GainMean'] = 1.
drsfile.drscalib['TriggerOffsetMean'] = 0.

drsfile.write()
del drsfile
